﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Urb.Weather.Core.Engine
{
    public class TimeSpanPeriod : IPeriod
    {   
        public TimeSpanPeriod(TimeSpan timespan)
        {
            if (timespan.TotalMilliseconds <= 0)
                throw new ArgumentException("timespan");

            this.TimeSpan = timespan;
        }

        public TimeSpan TimeSpan { get; private set; }

        public DateTime GetNextOccurrence(DateTime now)
        {
            return now.Add(TimeSpan);
        }
    }
}
